<template>
  <div style="width:73%; margin:14px auto;padding-top: 92px;padding-bottom: 20px;
  background-color: #ffffff; border-radius: 4px; opacity:0.9;
  min-height: calc(100vh - 120px);font-size: 16px;" class="ivew"
       :style="{backgroundImage: 'url(/res/ivew_background.svg)',backgroundSize:'100%',backgroundRepeat:'no-repeat'}">
    <div style="text-align: center;">
      <h1>{{ model.title }}</h1>
    </div>
    <div style="text-align: center;margin-bottom: 40px;margin-top: 50px;">
      <span style="margin-right: 50px;">发布时间：{{ elm.parseTime(model.publish_time) }}</span><span style="margin-left: 50px;">作者：{{ model.author }}</span>
    </div>
    <div v-html="model.content" style="width: 80%; margin-left: auto; margin-right: auto;" class="txt">
    </div>
    <elm-file-show :module_name="module_name" :rel_id="model.id" tip="相关附件" style="width: 80%;margin: 40px auto 0;"></elm-file-show>

  </div>
</template>
<script>
export default {
  extends: elmVueBase,
  data() {
    return {
      model: {},
      module_name:null
    }
  },
  async created() {
    this.getData();
  },
  methods: {
    async getData() {
      if(this.$route.query.news!=undefined) {
        this.module_name="biz_cms_news_files";
        this.model = await elm.post("/business/my/GetNews", {id: this.$parent.$route.query.news})
      }
      else if(this.$route.query.notice!=undefined) {
        this.module_name="biz_cms_notice_files";
        this.model = await elm.post("/business/my/GetNotice", {id: this.$parent.$route.query.notice})
      }
    }
  }
}
</script>

<style>
body{
  background-color: #e1e8f4 !important;
}
.ivew img{
  max-width: 100% !important;
  height: auto !important;
}
.ivew h1{
  font-size: 20pt;
  font-weight: bold;
  color: #505968;
}
.ivew span{
  font-size: 12pt;
  color: #808080;
}
.ivew div{
  font-size: 16pt;
  color: #505968;

}
</style>